//
//  TimeCell.swift
//  Employee
//
//  Created by swordjoy on 2017/5/11.
//  Copyright © 2017年 remotevillage. All rights reserved.
//

import UIKit

class TimeCell: UITableViewCell {
  
  static var identifier = "TimeCell.swordjoy"
  
  static var height: CGFloat = 30
  
  var time: String = "" {
    didSet {
      timeLabel.text = DateHelper.getOrderCreateFormatTime(timeInmillisecond: time)
    }
  }
  
  fileprivate var timeLabel: UILabel!
  
  // MARK: - life cycle
  override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
    super.init(style: style, reuseIdentifier: reuseIdentifier)
    backgroundColor = UIColor.white
    selectionStyle = .none
    
    create()
  }
  
  required init?(coder aDecoder: NSCoder) {
    fatalError("init(coder:) has not been implemented")
  }

}

// MARK: - fileprivate

extension TimeCell {
  
  fileprivate func create() {
    
    timeLabel = UILabel()
    addSubview(timeLabel)
    timeLabel.font = GlobalConfig.system12Font
    timeLabel.textColor = GlobalConfig.TextLightColor
    timeLabel.snp.makeConstraints { (make) in
      
      make.left.equalTo(20)
      make.top.equalTo(0)
    }
  }
  
}
